/*
 * @Author: fishroom
 * @Date: 2022-09-28 11:00:21
 * @LastEditTime: 2022-09-28 17:03:10
 * @FilePath: \koa-blog-backend\app\logger\index.ts
 */
import { configure, getLogger } from "log4js";
configure({
  appenders: {
    cheese: { type: "file", filename: "log/cheese.log" },
    access: { type: "file", filename: "log/access.log" },
    db: { type: "file", filename: "log/db.log" },
  },
  categories: {
    default: { appenders: ["cheese"], level: "info" },
    access: { appenders: ["access"], level: "info" },
    db: { appenders: ["db"], level: "info" },
  },
});
export const accessLogger = getLogger("access");
export const dbLogger = getLogger("db");
export default getLogger();
